Skip to content

CLOUDP-295785 - Calculate next version and release notes script #193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 35 commits into from
Jul 28, 2025

Conversation

MaciejKaras
Copy link
Collaborator

@MaciejKaras MaciejKaras commented Jun 16, 2025

Summary

Initial work for calculating next operator version and release notes. This is based on https://docs.google.com/document/d/1eJ8iKsI0libbpcJakGjxcPfbrTn8lmcZDbQH1UqMR_g/edit?tab=t.aov8hxoyxtos#heading=h.6q8mwv95pdu6.

This is not yet integrated with CI nor forces engineers to create change log files. There will be next smaller PRs that will address missing integration. Functionalities added by this PR:

  1. scripts.release.calculate_next_version.py -> this will calculate next version based on the changelog files provided.
➜  mongodb-kubernetes ✗ python3 -m scripts.release.calculate_next_version --help
usage: calculate_next_version.py [-h] [-p ] [-c ] [-s ] [-v ]

Calculate the next version based on the changes since the previous version tag.

options:
  -h, --help            show this help message and exit
  -p, --path            Path to the Git repository. Default is the current directory '.'
  -c, --changelog-path
                        Path to the changelog directory relative to the repository root. Default is 'changelog/'
  -s, --initial-commit-sha
                        SHA of the initial commit to start from if no previous version tag is found.
  -v, --initial-version
                        Version to use if no previous version tag is found. Default is '1.0.0'
  1. scripts.release.create_changelog.py -> this is a tool for creating changelog files. It makes life easier for engineers and reduces a chance for errors in filename and contents syntax
➜  mongodb-kubernetes ✗python3 -m scripts.release.create_changelog --help
usage: create_changelog.py [-h] [-c ] [-d ] [-e] -k  title

Utility to easily create a new changelog entry file.

positional arguments:
  title                 Title for the changelog entry

options:
  -h, --help            show this help message and exit
  -c, --changelog-path
                        Path to the changelog directory relative to a current working directory. Default is 'changelog/'
  -d, --date            Date in 'YYYY-MM-DD' format to use for the changelog entry. Default is today's date
  -e, --editor          Open the created changelog entry in the default editor (if set, otherwise uses 'vi'). Default is True
  -k, --kind            Kind of the changelog entry:
                          - 'prelude' for prelude entries
                          - 'breaking' for breaking change entries
                          - 'feature' for feature entries
                          - 'fix' for bugfix entries
                          - 'other' for other entries
  1. scripts.release.release_notes.py -> create release notes based on the changes since last release tag
➜  mongodb-kubernetes ✗ python3 -m scripts.release.release_notes --help
usage: release_notes.py [-h] [-p ] [-c ] [-s ] [-v ] [--output ]

Generate release notes based on the changes since the previous version tag.

options:
  -h, --help            show this help message and exit
  -p, --path            Path to the Git repository. Default is the current directory '.'
  -c, --changelog-path
                        Path to the changelog directory relative to the repository root. Default is 'changelog/'
  -s, --initial-commit-sha
                        SHA of the initial commit to start from if no previous version tag is found.
  -v, --initial-version
                        Version to use if no previous version tag is found. Default is '1.0.0'
  --output, -o          Path to save the release notes. If not provided, prints to stdout.

Proof of Work

Passing unit tests for now is enough.

Checklist

  • Have you linked a jira ticket and/or is the ticket in the title?
  • Have you checked whether your jira ticket required DOCSP changes?
  • Have you checked for release_note changes?

Reminder (Please remove this when merging)

  • Please try to Approve or Reject Changes the PR, keep PRs in review as short as possible
  • Our Short Guide for PRs: Link
  • Remember the following Communication Standards - use comment prefixes for clarity:
    • blocking: Must be addressed before approval.
    • follow-up: Can be addressed in a later PR or ticket.
    • q: Clarifying question.
    • nit: Non-blocking suggestions.
    • note: Side-note, non-actionable. Example: Praise
    • --> no prefix is considered a question

@MaciejKaras MaciejKaras self-assigned this Jun 16, 2025
@MaciejKaras MaciejKaras force-pushed the maciejk/ar-versioning branch 2 times, most recently from f705997 to 23e1224 Compare July 14, 2025 09:02
@MaciejKaras MaciejKaras marked this pull request as ready for review July 14, 2025 09:04
@MaciejKaras MaciejKaras requested a review from a team as a code owner July 14, 2025 09:04
@MaciejKaras MaciejKaras requested review from m1kola and Julien-Ben July 14, 2025 09:04
@MaciejKaras MaciejKaras force-pushed the maciejk/ar-versioning branch from 1052aae to 846787e Compare July 15, 2025 12:55
Copy link
Contributor

@m1kola m1kola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't reviewed everything, but I've tried the workflow with creating release notes and rendering it. Works really well. The only thing I noticed is that "Other Changes" section doesn't render (see a comment below with the reason).

@MaciejKaras MaciejKaras force-pushed the maciejk/ar-versioning branch 3 times, most recently from 64f2aa8 to d55f322 Compare July 16, 2025 14:31
Copy link
Collaborator

@Julien-Ben Julien-Ben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome changes, and tests 👏

Copy link
Contributor

@m1kola m1kola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've got a few questions, nits and suggestions. But overall I think it looks great.

Copy link
Contributor

@m1kola m1kola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few questions and one clarification for my previous comments.

I think overall it looks great - the only things which might need a bit of attention is ChangeKind.from_str.

Copy link
Contributor

@m1kola m1kola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! :shipit:

@MaciejKaras MaciejKaras merged commit 2988311 into master Jul 28, 2025
8 of 9 checks passed
@MaciejKaras MaciejKaras deleted the maciejk/ar-versioning branch July 28, 2025 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants